import request from '@/utils/request'
import querystring from 'querystring'

export function advertList(options, pageSize, pageNo) {
  const data = {
    pageNo,
    pageSize,
    ...options
  }
  return request.get('/platform/advert?' + querystring.stringify(data))
}

export function getAdvert(id) {
  return request.get('/platform/advert/' + id)
}
export function addAdvert(options) {
  return request.post('/platform/advert', options)
}

export function updateAdvert(options) {
  return request.put('/platform/advert/' + options.id, options)
}
export function activation(options) {
  return request.put('/platform/advert/activation/' + options.id + "/" + options.state)
}

export function deleteAdvert(id) {
  return request.delete('/platform/advert/' + id)
}

export function getAdvertDict() {
  return request.get('/platform/advert/dict')
}
